<style>
    .layui-laypage li{float: left;}
    .layui-laypage .active span{background: #009688; color: #fff;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>商品分类</legend>
</fieldset>
<div class="layui-row">
    <div class="layui-col-xs3">
        <div class="grid-demo grid-demo-bg1">
            <a href="{:url('categoryAdd')}" class="layui-btn layui-btn-sm">添加分类</a>
        </div>
    </div>
    <div class="layui-col-xs3">
        <div class="grid-demo">3/12</div>
    </div>
    <div class="layui-col-xs3">
        <div class="grid-demo grid-demo-bg1">3/12</div>
    </div>
    <div class="layui-col-xs3">
        <div class="grid-demo">3/12</div>
    </div>
</div>
<table class="layui-table">
    <colgroup>
        <col width="50">
        <col width="400">
        <col width="100">
        <col width="100">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>ID</th>
        <th>类名</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name='list' id='c'}
    <tr>
        <td>{$c.id}</td>
        <td>{$c.name}</td>
        <td>{$c.statu}</td>
        <td>
            <a href="{:url('categoryEdit',['id'=>$c.id])}">修改</a>
            <a href="javascript:void(0)" onclick="delCate({$c.id})">删除</a>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
<script>
    function delCate(id){
        if(confirm("该类下子类和商品都将被删除，确认删除吗?")){
            window.location.href="/admin/goods/catedel/id/"+id+".html";
        }else{
            return false;
        }
    }
</script>
